﻿using System.Text;
using System.Web.Mvc;
using Web.Base.Security;

namespace Web.Passport.Controllers
{
    public class MeController : Controller
    {
        public ActionResult Index()
        {
            var sb = new StringBuilder();
            sb.Append("Ayatta.Identity={");
            sb.AppendFormat("Name:'{0}',", User.Identity.Name);
            sb.AppendFormat("NickName:'{0}',", User.Identity.Identity().NickName);
            sb.AppendFormat("IsAuthenticated:{0}", User.Identity.IsAuthenticated.ToString().ToLower());
            sb.Append("};");
            return JavaScript(sb.ToString());
        }
    }
}
